package com.wsoft.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 功能描述
 *
 * @author: juiet
 * @date: 2024年08月23日 17:42
 */
@Configuration
public class Knife4jConfig {
    @Value("${swagger3.title}")
    private String title;
    @Value("${swagger3.description}")
    private String description;
    @Value("${swagger3.version}")
    private String version;
    @Value("${swagger3.auth}")
    private String auth;

    @Bean
    public OpenAPI openApi() {
    return new OpenAPI()
            .info(new Info()
                    .contact(new Contact().name(auth))
                    .title(title)
                    .version(version)
                    .description(description));
    }

}
